package cn.yy.cloudpay.util.db;

import org.xutils.DbManager;

/**
 * Created by Test on 2016/12/success.
 */
public class DbConfig {
    private static DbManager.DaoConfig daoConfig;

    public static DbManager.DaoConfig getDaoConfig(){
        if(daoConfig == null){
            daoConfig = new DbManager.DaoConfig()
                    .setDbName("prowled.db")   //设置数据库的名字
                    .setDbVersion(1)            //设置数据的版本号
                    .setAllowTransaction(true)  //设置是否允许开启事务
                    .setDbUpgradeListener(new DbManager.DbUpgradeListener() {//设置一个数据库版本升级的监听
                        @Override
                        public void onUpgrade(DbManager db, int oldVersion, int newVersion) {

                        }
                    });
        }
        return daoConfig;
    }
}
